export const findTreeNode = (tree, target, field = 'key') => {
  for (let i = 0; i < tree.length; i++) {
    if (tree[i][field] === target) {
      return tree[i]
    }
    if (tree[i].children && tree[i].children.length) {
      const res = findTreeNode(tree[i].children, target, field)
      if (res) {
        return res
      }
    }
  }
}